package com.vip.service.kafka;

import com.alibaba.fastjson.JSONObject;
import com.vip.dao.action.domain.SysOperLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.kafka.core.KafkaTemplate;

@Component
public class KafkaProducer {

    @Autowired
    private KafkaTemplate kafKaTemplate;

    //对事件进行处理
    public void fireEvent(SysOperLog sysOperLog){
        kafKaTemplate.send("sys-log", JSONObject.toJSONString(sysOperLog));
    }
}
